<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns="http://www.w3.org/1999/xhtml">

    <ui:define name="content">
        <h:panelGrid width="100%">
            <f:facet name="header">Usuário</f:facet>
        </h:panelGrid>

        <h:form >
            <h:panelGrid width="100%" class="direita">
                <h:column>
                    <h:commandButton value="Gravar" action="#{usuarioController.verificaAcao()}" />
                </h:column> 
            </h:panelGrid>
            <table width="100%">
                <tr>
                    <td>
                        <h:outputFormat value="Código "/>
                    </td>
                    <td>
                        <h:outputFormat value="Nome: "/>
                    </td>

                </tr>
                <tr>
                    <td>
                        <h:inputText value="#{usuarioController.usuario.id}" style="width: 60px" label="Código" readonly="true"/>
                    </td>
                    <td colspan="2">
                        <h:inputText value="#{usuarioController.usuario.nome}" label="Nome" style="width: 400px" required="true" >
                            <f:validateLength maximum="60" minimum="3" />
                        </h:inputText>
                    </td>

                </tr>
                <tr>
                    <td>
                        <h:outputFormat value="Permissão: "/>
                    </td>
                    <td>
                        <h:outputFormat value="Login "/>
                    </td>
                    <td>
                        <h:outputFormat value="Password: "/>
                    </td>
                </tr>

                <tr>
                    <td>
                        <h:inputText value="#{usuarioController.usuario.permissao}" label="Permissão" required="true" />
                    </td>
                    <td>
                        <h:inputText value="#{usuarioController.usuario.login}" style="width: 120px" label="Login" required="true"/>
                    </td>
                    <td>
                        <h:inputSecret value="#{usuarioController.usuario.password}" label="Password" required="true">
                            <f:validateLength maximum="60" minimum="3" />
                        </h:inputSecret>
                    </td>
                </tr>
            </table>
        </h:form>

    </ui:define>
</ui:composition>
